package com.web_bloks.document.client;

/**
 * DocumentAnalyzer
 * 
 * - Decodes 'meta' data 
 * 
 * @author Jean-Lou Dupont
 *
 */
public class DocumentAnalyzer {

	public final static String thisClass = "com.web_bloks.document.DocumentAnalyzer";
	
	public final static String HEADER_EDITABLE = "x-wb-editable";
	
	
	public static boolean isEditable(Document doc) {

		if (doc == null)
			throw new RuntimeException( thisClass+".isEditable: doc can't be null");
		
		// only when value = true
		if (doc.getMeta(HEADER_EDITABLE).indexOf("true") != -1) {
			return true;
		}
		
		return false;
	}
	
}
